from machine import SPI, Pin
from ssd1306 import SSD1306_SPI 
import utime

spi = machine.SPI(0, baudrate=1000000, polarity=0, phase=0)

dc = Pin(15)    # data/command
rst = Pin(12)   # reset
cs = Pin(13)   # chip select, some modules do not have a pin for this

oled = SSD1306_SPI(128, 64, spi, dc, rst, cs)


while True:
    # Clear the display
    oled.fill(0)
    # Display "Hello, World!" at (0, 0)
    oled.text("Hello, BearPi!", 0, 0, 1)
    # Refresh the display
    oled.show()
    utime.sleep(2)

